package com.ianmoone.JZOF;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;

public class HuaWei2 {
	public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[] time = new int [8];
        while(in.hasNextLine()){
        	String str = in.nextLine();
        	String[] split = str.split(",");
        	int[] a = new int[2];
        	if (Integer.valueOf(split[0])==-1 && Integer.valueOf(split[1])==-1) {
				break;
			}
        	a[0] = Integer.valueOf(split[0]);
        	a[1] = Integer.valueOf(split[1]);
        	if (a[0]<12) {
				a[0] = 12;
			}
        	if (a[0]>20) {
				a[0] = 20;
			}
        	if (a[1]<12) {
				continue;
			}
        	if (a[1]>20) {
				a[1]=20;
			}
        	if(a[0]>=12 && a[1]<=20){
        		for (int i = a[0]; i < a[1]; i++) {
    				time[i-12]++;
    			}
        	}
        	
        }
        for (int i = 0; i < time.length; i++) {
			if (time[i]!=0) {
				System.out.println("["+(i+12)+","+(i+13)+"):"+time[i]);
			}
		}
    }
}
